package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.api.model.vo.FrontGoodsVo;
import com.weixing.mall.provider.api.model.vo.GoodsDetailsVo;
import com.weixing.mall.provider.api.model.vo.GoodsEsVo;
import com.weixing.mall.provider.api.model.vo.GoodsPlaceVo;
import com.weixing.mall.provider.model.domain.Goods;
import com.weixing.mall.provider.model.query.FrontGoodsQuery;
import com.weixing.mall.provider.model.query.GoodsPlaceOrderQuery;
import com.weixing.mall.provider.model.query.GoodsQuery;
import com.weixing.mall.provider.model.query.HotGoodsQuery;
import com.weixing.mall.provider.model.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品模块-商品表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-20
 */
public interface GoodsMapper extends BaseMapper<Goods> {
    void delAll(int[] ids);

    List<GoodsVo> selectStatusBeforeDelete(int[] ids);

    List<Goods> selectGoodsList(Long [] ids);

    void Recovery( List<GoodsVo> list);

    void   updateStatus(List<GoodsVo> list);

    List<GoodsVo> selectStatus(int[] ids);

    IPage<GoodsVo> selectListByIds(@Param("pg") Page page,int[] ids);

    IPage<GoodsVo> selectList(@Param("pg") Page page, @Param("qs")GoodsQuery goodsQuery);

    List<GoodsVo> selectList(@Param("qs")GoodsQuery goodsQuery);

    IPage<GoodsVo> selectNoSkuList(@Param("pg") Page page, @Param("qs")GoodsQuery goodsQuery);
    IPage<GoodsVo> selectRecycleList(@Param("pg") Page page, @Param("qs")GoodsQuery goodsQuery);

    Integer insertId(@Param("qs")Goods goods);

    GoodsDetailsVo selectDetilById(Long id);

    GoodsEsVo selectGoodsSearchVo(long goodsId);

    List<Goods> selectAllList(@Param(value = "sortType") int sortType);

    List<GoodsPlaceVo> selectGoods(@Param("qs")GoodsPlaceOrderQuery goodsPlaceOrderQuery);

    IPage<GoodsPlaceVo> selectGoods(@Param("pg") Page page,@Param("qs")GoodsPlaceOrderQuery goodsPlaceOrderQuery);

    IPage<FrontGoodsVo> hotGoods(@Param("pg") Page page, @Param("qs")HotGoodsQuery hotGoodsQuery);

    IPage<FrontGoodsVo> actHotGoods(@Param("pg") Page page, @Param("qs")HotGoodsQuery hotGoodsQuery);

    IPage<FrontGoodsVo> selectFrontGoods(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery);

    //按照价格和分类进行查询
    IPage<FrontGoodsVo> findBycatAndPrice(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery);
    //按照场景去查询
    IPage<FrontGoodsVo> findByscene(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery);
    //按照颜色和尺码进行查询
    IPage<FrontGoodsVo> findByColorAndSize(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery);

    //按照参数进行查询
    IPage<FrontGoodsVo> findByParameter(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery,@Param("array")List<String> params,@Param("list")List<String> paramvalues);
    IPage<FrontGoodsVo> selectActFrontGoods(@Param("pg") Page page, @Param("qs")FrontGoodsQuery frontGoodsQuery);

    Integer findOrder(@Param("array")  int[] ids);

    Integer findProduct(@Param("array") int[] ids);

    FrontGoodsVo findByImgSearch(@Param("actId") Long actId,@Param("productId") String productId);
}
